<script lang="ts" setup>
import { uniEvent } from '@/enums'

const props = withDefaults(defineProps<{
  loading: boolean
}>(), {
  loading: true,
})

const emits = defineEmits<{
  (e: 'close'): void
}>()

uni.$on(uniEvent.关闭Loading, () => {
  emits('close')
})
</script>

<template>
  <view v-if="loading" class="w100vw h100vh fixed left-0 top-0 z-499 bg-white flex flex-col items-center justify-center">
    <image src="../static/loading.gif" class="w240rpx h240rpx mb-32rpx" />
    <text class="text-[#999] text-24rpx leading-36rpx">
      客官稍等，努力加载中…
    </text>
  </view>
</template>
